﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace DTO
{
    public class SubmitTakeTaskDataDto
    {
        /// <summary>
        /// 收集图片数据
        /// </summary>
        public List<StepFile> StepFieldData { get; set; }
        /// <summary>
        /// 提交数据 值
        /// </summary>
        public string SubFieldValue { get; set; }
        /// <summary>
        /// 领取任务ID
        /// </summary>
        public int TaskTakeID { get; set; }

        public string GetJsonData()
        {
            return JsonConvert.SerializeObject(this);
        }

        public static SubmitTakeTaskDataDto Parse(string json)
        {
            if (string.IsNullOrWhiteSpace(json)) return null;
            
            SubmitTakeTaskDataDto submitTakeTaskDataDto = JsonConvert.DeserializeObject<SubmitTakeTaskDataDto>(json);

            return submitTakeTaskDataDto;
        }
    }

    public class StepFile
    {
        /// <summary>
        /// 提交截图ID
        /// </summary>
        public Guid ID { get; set; }
        /// <summary>
        /// 图片地址
        /// </summary>
        public string PicUrl { get; set; }

        //public string Text { get; set; }
    }
}
